package com.vogue.supplymall.shop.domain.dao.impl;

import com.vogue.supplymall.shop.domain.dao.ProductDetailsDao;
import com.vogue.supplymall.shop.domain.mapper.ProductDetailsMapper;
import com.vogue.supplymall.shop.domain.model.ProductDetails;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * The type Product details dao.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-01-02
 */
@Repository("productDetailsDao")
public class ProductDetailsDaoImpl extends BaseDaoImpl<ProductDetails, Long> implements ProductDetailsDao {

    /**
     * The Product details mapper.
     */
    @Resource
    private ProductDetailsMapper productDetailsMapper;

    @Override
    public List<ProductDetails> findProductDeta(ProductDetails productDetails) {
        return productDetailsMapper.getProductDeta(productDetails);
    }

	@Override
	public List<ProductDetails> findProductDetailsBySP(Long syscodeid, Long productid) {

		return productDetailsMapper.findProductDetailsBySP(syscodeid, productid);
	}

	@Override
	public int delProductDetailsBySP(Long syscodeId, Long productIid) {
		String sql="delete from product_details where syscodeid="+syscodeId+" and productid="+productIid;
		
		int cnt=this.delete(sql);
		
		return cnt;
	}
    
}